import { defineStore } from 'pinia'

type WordsGroup = { easy: string[], medium: string[], hard: string[] }

export const useVocabStore = defineStore('vocab', {
  state: () => ({
    round1: {
      words: { easy: [], medium: [], hard: [] } as WordsGroup,
      known: { easy: [], medium: [], hard: [] } as WordsGroup,
      unknown: { easy: [], medium: [], hard: [] } as WordsGroup,
    },
    result: null as null | {
      vocabularySize: number
      level: string
      confidence: number
    }
  }),
  actions: {
    reset() {
      this.round1 = {
        words: { easy: [], medium: [], hard: [] },
        known: { easy: [], medium: [], hard: [] },
        unknown: { easy: [], medium: [], hard: [] }
      }
      this.result = null
    }
  }
}) 